package com.chinasoft.maysham.manager.controller.project;

import com.chinasoft.maysham.manager.controller.BaseController;
import com.chinasoft.maysham.manager.model.ProjectConfig;
import com.chinasoft.maysham.manager.service.config.ProjectConfigService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/projects/{projectId}")
public class ProjectConfigController extends BaseController {

    @Resource
    private ProjectConfigService projectConfigService;

    @GetMapping("/configs")
    public ProjectConfig queryConfig(@PathVariable String projectId) {
        return projectConfigService.queryConfig(projectId);
    }

    public ProjectConfig update(@PathVariable String projectId, @RequestBody ProjectConfig config) {
        return projectConfigService.updateConfig(projectId,config);
    }
}
